use axum::{
    middleware,
    routing::{post, get},
    Router,
};
use crate::{
    handlers::auth::{register, login, get_profile},
    middleware::auth_middleware,
    services::UserService,
};

pub fn auth_routes(user_service: UserService) -> Router {
    Router::new()
        .route("/register", post(register))
        .route("/login", post(login))
        .route("/profile", get(get_profile).layer(middleware::from_fn_with_state(
            user_service.clone(),
            auth_middleware,
        )))
        .with_state(user_service)
} 